//
//  BGTwoCell.m
//  bigMall
//
//  Created by ios on 16/9/18.
//  Copyright © 2016年 thinklev. All rights reserved.
//

#import "BGTwoCell.h"
#import "SZAddImage.h"
#import "BGReadStepTwoModel.h"
@interface BGTwoCell ()<SZAddImageDlegate> {
    UILabel *titleLab;
    NSMutableArray *_dataArr;
}
@end
@implementation BGTwoCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        //修饰线
        UIView *v1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 1)];
        v1.backgroundColor = dockwhite_;
        [self.contentView addSubview:v1];
        
        titleLab = [[UILabel alloc] initWithFrame:CGRectMake(21, 6, 100, 21)];
        titleLab.text = @"货物图样";
        //设置标题的大小
        CGSize biaotiSize = [titleLab.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:titleLab.font,NSFontAttributeName, nil]];
        titleLab.width = biaotiSize.width;
        titleLab.height = biaotiSize.height;
        titleLab.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:titleLab];
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 32, [UIScreen mainScreen].bounds.size.width, 1)];
        view.backgroundColor = dockwhite_;
        [self.contentView addSubview:view];
        
        SZAddImage *a = [[SZAddImage alloc] initWithFrame:CGRectMake(27, 49, [UIScreen mainScreen].bounds.size.width - 27, 270)];
        
        a.delegate = self;
        
        [self.contentView addSubview:a];
        
    }
   
    return self;
    
}
- (void)imagesChange:(NSMutableArray *)dataArr {
    
    if ([_delegate respondsToSelector:@selector(imagesChange:index:)]) {
        [_delegate imagesChange:dataArr index:@"1"];
    }
    
}
- (void)setTitleText:(NSString *)titleText {
    titleLab.text = titleText;
}
- (void)layoutSubviews {
    
    //设置标题的大小
    CGSize biaotiSize = [titleLab.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:titleLab.font,NSFontAttributeName, nil]];
    titleLab.width = biaotiSize.width;
    titleLab.height = biaotiSize.height;
    
}

@end
